package cn.demoncat.util.pay.unionpay.entity;

import cn.demoncat.util.pay.unionpay.constant.UnionpayConstant;

/**
 * 银联结果：响应/通知
 * 
 * @author 延晓磊
 *
 * @since 2020年3月27日
 */
public class UnionpayResult {

	/**
	 * 交易类型：TxnType
	 */
	private String txnType;
	/**
	 * 响应码：00表示受理/成功，应再发起资金查询来确认
	 */
	private String respCode;
	/**
	 * 响应消息
	 */
	private String respMsg;
	/**
	 * 业务保留域：通知、查询时原样返回
	 */
	private String reqReserved;

	public UnionpayResult() {
		super();
	}

	public UnionpayResult(String txnType, String respCode, String respMsg, String reqReserved) {
		super();
		this.txnType = txnType;
		this.respCode = respCode;
		this.respMsg = respMsg;
		this.reqReserved = reqReserved;
	}

	/**
	 * 是否成功应答
	 * 
	 * @return respCode == '00'
	 * 
	 * @author 延晓磊
	 *
	 * @since 2020年3月27日
	 */
	public boolean isSuccess() {
		return UnionpayConstant.RESP_CODE_SUCCESS.equals(respCode);
	}
	
	public String getRespCode() {
		return respCode;
	}

	public void setRespCode(String respCode) {
		this.respCode = respCode;
	}

	public String getRespMsg() {
		return respMsg;
	}

	public void setRespMsg(String respMsg) {
		this.respMsg = respMsg;
	}

	public String getTxnType() {
		return txnType;
	}

	public void setTxnType(String txnType) {
		this.txnType = txnType;
	}

	public String getReqReserved() {
		return reqReserved;
	}

	public void setReqReserved(String reqReserved) {
		this.reqReserved = reqReserved;
	}
	
	
}
